package com.yanq.liancar.activity;
/*
 *  @创建者     liyan
 *  @创建时间   2018/10/27  9:28
 *  @描述       ${TODO}
 */


import android.graphics.Typeface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.yanq.liancar.R;
import com.yanq.liancar.activity.base.BaseToolbarActivity;
import com.yanq.liancar.util.GlideImageLoader;
import com.yanq.liancar.util.Utils;
import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;
import com.youth.banner.listener.OnBannerListener;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class DesignatedDrivingActivity extends BaseToolbarActivity {
    @BindView(R.id.tv_call)
    TextView tvCall;
    @BindView(R.id.banner)
    Banner banner;
    @BindView(R.id.tv_quyu)
    TextView tvQuyu;
    @BindView(R.id.tv_feiyong)
    TextView tvFeiyong;
    @BindView(R.id.text1)
    TextView text1;
    @BindView(R.id.text2)
    TextView text2;
    @BindView(R.id.text3)
    TextView text3;

    private List<Integer> imageUrl;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_designateddriving);
        ButterKnife.bind(this);
        Utils.setStatusBar(this, true,false);
        mTvTitle.setText("代驾服务");
        initBannerData();

        Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/PINGFANGBOLD.TTF");
        text1.setTypeface(typeface);
        text2.setTypeface(typeface);
        text3.setTypeface(typeface);

        text1.setText("e代驾师傅平均驾龄9年以上=安全");
        text2.setText("e代驾师傅平均到达时间5分钟=快速");
        text3.setText("e代驾已开通全国300个城市=便捷");

    }

    private void initBannerData() {
        imageUrl = new ArrayList<>();
        imageUrl.add(R.mipmap.banner);
        imageUrl.add(R.mipmap.banner);
        imageUrl.add(R.mipmap.banner);
        banner.setImageLoader(new GlideImageLoader())
                .setImages(imageUrl)//设置图片集合
                .setDelayTime(3000)//设置轮播时间
                .setBannerStyle(BannerConfig.CIRCLE_INDICATOR)//设置指示器位置（当banner模式中有指示器时）
                .setIndicatorGravity(BannerConfig.CENTER)
                .start();//banner设置方法全部调用完毕时最后调用
        banner.setOnBannerListener(new OnBannerListener() {
            @Override
            public void OnBannerClick(int position) {
                //ToastUtils.showToast(SmallBGoodsDetailsActivity.this, "您点击了第" + (mBanners.get(position).type + 1) + "张照片");
            }
        });
    }
}
